package service;

import bean.dto.ExpenseTypePage;
import bean.pojo.ExpenseType;
import bean.vo.ExpenseTypeOption;
import commons.r.R;
import dao.ExpenseTypeDao;
import dao.impl.ExpenseTypeDaoImpl;

import java.util.List;

/**
 * service
 * User: xlh
 * Date: 2024/12/17 9:52
 * motto:推到高塔
 * Description:
 * Version: V1.0
 */
public interface ExpenseTypeService {
    ExpenseTypeDao expenseTypeDao=new ExpenseTypeDaoImpl() ;
    static Long findByTotal(ExpenseTypePage expenseTypePage) {
        if(expenseTypePage.getTypeTime()==null  ||  expenseTypePage.getTypeTime().trim().length()==0){
            expenseTypePage.setTypeTime(null);
        }
        return   expenseTypeDao.findByTotal(expenseTypePage);
    }

    List<ExpenseType> findByPage(ExpenseTypePage expenseTypePage);

    List<ExpenseTypeOption> findAllList();

    boolean updateById(ExpenseType expenseType);

    boolean insert(ExpenseType expenseType);

    boolean deleteById(Integer typeId);

    boolean createType(String typeName);
}
